<template>
  <div class="app-container">

    <el-tabs type="border-card">
      <el-tab-pane>
        <span slot="label"><i class="el-icon-date"></i>贷款合同</span>
        <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
          <el-table-column width="120" label="年度" align="center" prop="duringYear" fixed="left" />
          <el-table-column label="借款人信息(学生)" align="center" >
            <el-table-column width="120" label="QQ" align="center" prop="qq" />
            <el-table-column width="180" label="学生身份证" align="center" prop="cardIdentity" />
            <el-table-column width="120" label="户口性质" align="center" prop="residence" />
            <el-table-column width="120" label="毕业中学" align="center" prop="medium" :show-overflow-tooltip="true" />
            <el-table-column width="120" label="户籍" align="center" prop="household" :show-overflow-tooltip="true" />
            <el-table-column width="120" label="申贷原因" align="center" prop="applyReason" :show-overflow-tooltip="true" />
            <el-table-column width="180" label="学生身份证有效起始日期" align="center" prop="studentEffectiveCardIdentity">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.studentEffectiveCardIdentity) }}</span>
              </template>
            </el-table-column>
            <el-table-column width="180" label="学生身份证有效结束日期" align="center" prop="studentInvalidCardIdentity" >
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.studentInvalidCardIdentity) }}</span>
              </template>
            </el-table-column>
          </el-table-column>
          <el-table-column width="120" label="共同借款人" align="center" :show-overflow-tooltip="true" >
            <el-table-column width="120" label="共同借款人姓名" align="center" prop="guarantor" :show-overflow-tooltip="true" />
            <el-table-column width="180" label="共同借款人联系电话" align="center" prop="guaPhone" :show-overflow-tooltip="true" />
            <el-table-column width="120" label="关系" align="center" prop="relation" :show-overflow-tooltip="true" />
            <el-table-column width="180" label="共同借款人身份证号" align="center" prop="guaCardIdentity" :show-overflow-tooltip="true" />
            <el-table-column width="120" label="健康状态" align="center" prop="heath" :show-overflow-tooltip="true" />
          </el-table-column>
          <el-table-column width="240" label="资助中心" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.supportCenterProvince }} {{ scope.row.supportCenterCity }} {{ scope.row.supportCenterArea }}</span>
            </template>
          </el-table-column>
          <el-table-column width="240" label="入学前户籍所在地" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.householdOfProvince }} {{ scope.row.householdOfCity }} {{ scope.row.householdOfArea }} {{ scope.row.householdOfCounty }} {{ scope.row.householdOfDetail }}</span>
            </template>
          </el-table-column>
          <el-table-column label="家庭住址" align="center" :show-overflow-tooltip="true" >
            <el-table-column width="240" label="家庭住址所在地" align="center" >
              <template slot-scope="scope">
                <span>{{ scope.row.homeOfProvince }} {{ scope.row.homeOfCity }} {{ scope.row.homeOfArea }} {{ scope.row.homeOfCounty }} {{ scope.row.homeOfDetail }}</span>
              </template>
            </el-table-column>
            <el-table-column width="140" label="是否与户籍地址一致" align="center" prop="isTheSameAsHousehold" :show-overflow-tooltip="true" >
              <template slot-scope="scope">
                <span>{{ scope.row.isTheSameAsHousehold === 'true' ? '是' : '否'  }}</span>
              </template>
            </el-table-column>
            <el-table-column width="140" label="家庭住址邮政编码" align="center" prop="homeOfPostcode" :show-overflow-tooltip="true" />
            <el-table-column width="120" label="家庭电话" align="center" prop="homeOfPhone" :show-overflow-tooltip="true" />
          </el-table-column>
          <el-table-column label="就学信息" align="center" :show-overflow-tooltip="true" >
            <el-table-column label="高校名称" align="center" prop="collegeOfName" :show-overflow-tooltip="true" />
            <el-table-column width="160" label="院系名称" align="center" prop="collegeOfInstitute" :show-overflow-tooltip="true" />
            <el-table-column label="专业名称" align="center" prop="collegeOfMajor" :show-overflow-tooltip="true" />
            <el-table-column label="入学时间" align="center" prop="collegeWithStart" width="180">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.collegeWithStart) }}</span>
              </template>
            </el-table-column>
            <el-table-column label="学历" align="center" prop="collegeOfEducation" :show-overflow-tooltip="true" />
            <el-table-column width="120" label="学生学号" align="center" prop="studentNo" :show-overflow-tooltip="true" />
            <el-table-column label="专业类别" align="center" prop="typeOfMajor" :show-overflow-tooltip="true" />
            <el-table-column label="学制" align="center" prop="collegeOfEducationalSystem" :show-overflow-tooltip="true" />
            <el-table-column label="毕业时间" align="center" prop="collegeWithEnd" width="120" />
          </el-table-column>
          <el-table-column width="120" label="资格审查确认" align="center" :show-overflow-tooltip="true" >
            <el-table-column width="120" label="资格审查单位" align="center" prop="countyUnit" :show-overflow-tooltip="true" />
            <el-table-column width="120" label="是否盖章" align="center" prop="isSeal" :show-overflow-tooltip="true" />
            <el-table-column width="120" label="盖章日期" align="center" prop="sealDate" :show-overflow-tooltip="true" />
            <el-table-column width="120" label="学生签字日期" align="center" prop="signatureDate"/>
          </el-table-column>
          <el-table-column label="就业信息" align="center" :show-overflow-tooltip="true" >
            <el-table-column label="工作单位" align="center" prop="workFeature" :show-overflow-tooltip="true" />
            <el-table-column label="单位性质" align="center" prop="phoneOfUnit" :show-overflow-tooltip="true" />
            <el-table-column label="单位电话" align="center" prop="postCodeOfUnit" :show-overflow-tooltip="true" />
            <el-table-column width="140" label="单位邮政编码" align="center" prop="addressOfUnit" :show-overflow-tooltip="true" />
            <el-table-column label="单位地址" align="center" prop="addressOfUnit" :show-overflow-tooltip="true" />
          </el-table-column>
          <el-table-column label="变更" align="center" prop="changeForReason" :show-overflow-tooltip="true" />
          <el-table-column label="操作" align="center" fixed="right" width="140" class-name="small-padding fixed-width">
            <template slot-scope="scope">
              <el-button
                size="small"
                type="primary"
                icon="el-icon-search"
                @click="handleUpdate(scope.row)"
              >查看高级信息</el-button>
            </template>
          </el-table-column>
        </el-table>

        <pagination
          v-show="total>0"
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="getList"
        />

        <el-dialog style="height: 800px" width="1070px" title="学生贷款基本信息" :visible.sync="open" append-to-body>

          <el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="120px" style="width: 1060px; height: 1240px">
            <el-form-item style="width: 1000px">
              <el-tag
                type=""
                effect="plain">
                基本信息
              </el-tag>
            </el-form-item>
            <el-form-item label="年度" prop="duringYear" style="margin-left: -28px">
              {{form.duringYear}}
            </el-form-item>
            <el-form-item label="学生身份证" prop="cardIdentity">
              {{form.cardIdentity}}
            </el-form-item>
            <el-form-item label="身份证有效起始日期" prop="studentEffectiveCardIdentity" style="margin-left: 40px"  label-width="140px">
              {{form.studentEffectiveCardIdentity}}
            </el-form-item>
            <el-form-item label="身份证有效结束日期" prop="studentInvalidCardIdentity" style="margin-left: 20px" label-width="140px">
              {{form.studentInvalidCardIdentity}}
            </el-form-item>
            <el-form-item label="毕业中学" prop="medium">
              {{form.medium}}
            </el-form-item>
            <el-form-item label="户籍" prop="household">
              {{form.household}}
            </el-form-item>
            <el-form-item label="户口性质" prop="residence">
              {{form.residence}}
            </el-form-item>
            <el-form-item label="资助中心" prop="supportCenterProvince">
              {{form.supportCenterProvince}}
            </el-form-item>
            <el-form-item label="共同借款人信息" prop="guarantor" style="margin-left: 20px">
              {{form.guarantor}}
            </el-form-item>
            <el-form-item label-width="180" label="共同借款人联系电话" prop="guaPhone" style="margin-left: 50px">
              {{form.guaPhone}}
            </el-form-item>
            <el-form-item label-width="180" label="关系" prop="relation" style="margin-left: 20px">
              {{form.relation}}
            </el-form-item>
            <el-form-item label-width="180" label="共同借款人身份证号" prop="guaCardIdentity" style="margin-left: 20px">
              {{form.guaCardIdentity}}
            </el-form-item>
            <el-form-item label-width="180" label="共同借款人健康状态" prop="heath" style="margin-left: 20px">
              {{form.heath}}
            </el-form-item>
            <el-form-item label="入学前户籍所在地" prop="householdOfProvince" label-width="200" style="margin-left: 48px" >
              {{form.householdOfProvince}}
            </el-form-item>
            <el-form-item label="申贷原因*" prop="applyReason" style="margin-left: -10px">
              {{form.applyReason}}
            </el-form-item>
            <el-divider></el-divider>
            <el-form-item style="width: 1000px">
              <el-tag
                type="success"
                effect="plain">
                通讯信息
              </el-tag>
            </el-form-item>
            <el-form-item label="手机" prop="phone" style="margin-left: -30px">
              {{form.phone}}
            </el-form-item>
            <el-form-item label="邮政编码" prop="postcode">
              {{form.postcode}}
            </el-form-item>
            <el-form-item label="邮箱" prop="email">
              {{form.email}}
            </el-form-item>
            <el-form-item label="QQ" prop="qq">
              {{form.qq}}
            </el-form-item>
            <el-form-item label="通讯地址" prop="address">
              {{form.address}}
            </el-form-item>
            <el-divider></el-divider>
            <el-form-item style="width: 1000px">
              <el-tag
                type="danger"
                effect="plain">
                家庭信息
              </el-tag>
            </el-form-item>
            <el-form-item label="家庭地址" prop="homeOfProvince" label-width="120" style="margin-left: 50px">
              {{form.homeOfDetail}}
            </el-form-item>
            <el-form-item label="家庭住址邮政编码" prop="homeOfPostcode" label-width="140" style="margin-left: 40px">
              {{form.homeOfPostcode}}
            </el-form-item>
            <el-form-item label="家庭电话" prop="homeOfPhone">
              {{form.homeOfPhone}}
            </el-form-item>
            <el-divider></el-divider>
            <el-form-item style="width: 1000px">
              <el-tag
                type="warning"
                effect="plain">
                联系人信息
              </el-tag>
            </el-form-item>
            <el-form-item label="联系人姓名" prop="concatOfName" style="margin-left: 14px">
              {{form.concatOfName}}
            </el-form-item>
            <el-form-item label="工作单位" prop="concatWorkUnit">
              {{form.concatWorkUnit}}
            </el-form-item>
            <el-form-item label="联系人电话" prop="concatOfPhone">
              {{form.concatOfPhone}}
            </el-form-item>
            <el-form-item label="联系人身份证号" prop="concatOfCardIdentity" style="margin-left: 40px">
              {{form.concatOfCardIdentity}}
            </el-form-item>
            <el-divider></el-divider>
            <el-form-item style="width: 1000px">
              <el-tag
                type=""
                effect="plain">
                就学信息
              </el-tag>
            </el-form-item>
            <el-form-item label="高校名称" prop="collegeOfName">
              {{form.collegeOfName}}
            </el-form-item>
            <el-form-item label="院系名称" prop="collegeOfInstitute">
              {{form.collegeOfInstitute}}
            </el-form-item>
            <el-form-item label="专业名称" prop="collegeOfMajor">
              {{form.collegeOfMajor}}
            </el-form-item>
            <el-form-item label="学历" prop="collegeOfEducation">
              {{form.collegeOfEducation}}
            </el-form-item>
            <el-form-item label="入学时间" prop="collegeWithStart">
              {{form.collegeWithStart}}
            </el-form-item>
            <el-form-item label="学号" prop="studentNo" style="margin-left: -28px">
              {{form.studentNo}}
            </el-form-item>
            <el-form-item label="专业类别" prop="typeOfMajor">
              {{form.typeOfMajor}}
            </el-form-item>
            <el-form-item label="学制" prop="collegeOfEducationalSystem">
              {{form.collegeOfEducationalSystem}}
            </el-form-item>
            <el-form-item label="毕业时间" prop="collegeWithEnd" label-width="140px">
              {{form.collegeWithEnd}}
            </el-form-item>
            <el-divider></el-divider>
            <el-form-item style="width: 1000px">
              <el-tag
                type="success"
                effect="plain">
                就业信息
              </el-tag>
            </el-form-item>
            <el-form-item label="工作单位" prop="workUnit">
              {{form.workUnit}}
            </el-form-item>
            <el-form-item label="单位性质" prop="workFeature">
              {{form.workFeature}}
            </el-form-item>
            <el-form-item label="单位电话" prop="phoneOfUnit">
              {{form.phoneOfUnit}}
            </el-form-item>
            <el-form-item label="单位邮政编码" prop="postcodeOfUnit" style="margin-left: 40px">
              {{form.postcodeOfUnit}}
            </el-form-item>
            <el-form-item label="单位地址" prop="addressOfUnit">
              {{form.addressOfUnit}}
            </el-form-item>
            <el-divider></el-divider>
            <el-form-item style="width: 1000px">
              <el-tag
                type="danger"
                effect="plain">
                其它信息
              </el-tag>
            </el-form-item>
            <el-form-item label="变更原因*" prop="changeForReason">
              {{form.changeForReason}}
            </el-form-item>
          </el-form>

          <div style="margin-top: -270px" slot="footer" class="dialog-footer">
            <el-button type="primary" @click="open = false">确 定</el-button>
            <el-button @click="open = false">取 消</el-button>
          </div>
        </el-dialog>
      </el-tab-pane>
      <el-tab-pane label="贫困证明">
        <span slot="label"><i class="el-icon-question"></i>贫困证明</span>
          <img v-for="(item, index) in certificatArray" :key="index" style="width: 1000px; height: 600px;float: left; margin-top: 10px;" :src="'http://localhost:8080' + item">
      </el-tab-pane>
      <el-tab-pane label="学生录取通知书">
        <span slot="label"><i class="el-icon-eleme"></i>学生录取通知书</span>
        <img style="width: 1000px; height: 600px" v-for="(item, index) in letterOfAdmissionArray" :key="index" :src="'http://localhost:8080' + item">
      </el-tab-pane>
      <el-tab-pane label="学生身份证">
        <span slot="label"><i class="el-icon-info"></i>学生身份证</span>
        <img style="width: 1000px; height: 600px" v-for="(item, index) in identityPathOfFrontArray" :key="index" :src="'http://localhost:8080' + item">
      </el-tab-pane>
      <el-tab-pane label="户口本资料">
        <span slot="label"><i class="el-icon-camera-solid"></i>户口本资料</span>
        <img style="width: 1000px; height: 600px" v-for="(item, index) in householdRegistrationBookArray" :key="index" :src="'http://localhost:8080' + item">
      </el-tab-pane>
    </el-tabs>

  </div>
</template>

<script>

  import { listData, getData, delData, addData, updateData, exportData } from "@/api/county/credit";
  import { listUser, getUser } from "@/api/system/user";
  import { regionData,CodeToText } from 'element-china-area-data'
  import { getCredits } from '../../../api/county/credit'

  export default {
    data() {
      return {
        certificatArray: [],
        letterOfAdmissionArray: [],
        householdRegistrationBookArray: [],
        identityPathOfFrontArray: [],
        electronicImagePath: '',
        now_creditId: '',
        current_creditId: '',
        pdfPath: '',
        options: regionData,
        selectedOptions: [],
        collegeOfEducationArray: [
          '小学',
          '中学',
          '高中',
          '大专',
          '本科',
          '研究生',
          '硕士',
          '博士',
        ],
        collegeOfEducationalSystemArray: [
          '三年',
          '四年',
          '五年',
        ],
        typeOfMajorArray: [
          '哲学',
          '经济学',
          '法学',
          '教育学',
          '文学',
          '历史学',
          '理学',
          '工学',
          '农学',
          '医学',
          '军事学',
          '管理学',
          '艺术学',
        ],
        residenceArray: [
          "城镇户口",
          "农业户口",
        ],
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 总条数
        total: 0,
        // 学生贷款表格数据
        dataList: [],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        // 状态数据学生贷款
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          creditName: undefined,
          userName: undefined,
          status: undefined
        },
        // 表单参数
        form: {},
        // 表单校验
        rules: {
          duringyear: [
            { required: true, message: "数据标签不能为空", trigger: "blur" }
          ],
          creditValue: [
            { required: true, message: "数据键值不能为空", trigger: "blur" }
          ],
          creditSort: [
            { required: true, message: "数据顺序不能为空", trigger: "blur" }
          ]
        },
        yearOptions: [
          "2014-2015",
          "2015-2016",
          "2016-2017",
          "2017-2018",
          "2018-2019",
          "2019-2020",
          "2020-2021",
          "2021-2022",
          "2022-2023",
          "2023-2024",
          "2024-2025",
        ]
      };
    },
    created() {
      const userId = this.$route.params && this.$route.params.userId;
      this.getUser(userId);
    },
    methods: {
      handleChangeSupportCenter (value) {
        let data = CodeToText[value[0]]+", "+ CodeToText[value[1]]+", "+ CodeToText[value[2]];
        this.form.supportCenterProvince = CodeToText[value[0]]
        this.form.supportCenterCity = CodeToText[value[1]]
        this.form.supportCenterArea = CodeToText[value[2]]
        console.log(data)
      },
      handleChangeHousehold (value) {
        let data = CodeToText[value[0]]+", "+ CodeToText[value[1]]+", "+ CodeToText[value[2]];
        this.form.householdOfProvince = CodeToText[value[0]]
        this.form.householdOfCity = CodeToText[value[1]]
        this.form.householdOfArea = CodeToText[value[2]]
        console.log(data)
      },
      handleChangeHome (value) {
        let data = CodeToText[value[0]]+", "+ CodeToText[value[1]]+", "+ CodeToText[value[2]];
        this.form.homeOfProvince = CodeToText[value[0]]
        this.form.homeOfCity = CodeToText[value[1]]
        this.form.homeOfArea = CodeToText[value[2]]
        console.log(data)
      },
      /** 查询学生贷款类型详细 */
      getUser(userId) {
        getUser(userId).then(response => {
          this.queryParams.userName = response.data.userName;
          this.getList();
        });
      },
      /** 查询学生贷款数据列表 */
      getList() {
        this.loading = true;
        listData(this.queryParams).then(response => {
          this.dataList = response.rows;
          console.log(response.rows)
          let arr = []
          let arr2 = []
          let arr3 = []
          let arr4 = []
          for (let i in response.rows) {
              arr.push(response.rows[i].letterOfAdmission)
              arr2.push(response.rows[i].certificat)
              arr3.push(response.rows[i].householdRegistrationBook)
              arr4.push(response.rows[i].identityPathOfFront)
          }
          this.letterOfAdmissionArray = arr
          this.certificatArray = arr2
          this.householdRegistrationBookArray = arr3
          this.identityPathOfFrontArray = arr4
          this.total = response.total;
          this.loading = false;
        });
      },
      // 取消按钮
      cancel() {
        this.open = false;
        this.reset();
      },
      // 表单重置
      reset() {
        this.form = {
          creditId: undefined,
          duringYear: undefined,
          qq: undefined,
          birth: undefined,
          cardIdentity: undefined,
          residence: undefined,
          medium: undefined, household: undefined,
          email: undefined, address: undefined, postcode: undefined,
          guarantor: undefined, guaPhone: undefined, relation: undefined,
          guaCardIdentity: undefined, heath: undefined,
          applyReason: undefined, signatureDate: undefined, countryUnit: undefined,
          isSeal: undefined, sealDate: undefined, studentEffectiveCardIdentity: undefined,
          studentInvalidCardIdentity: undefined, supportCenterProvince: undefined,
          supportCenterCity: undefined, supportCenterArea: undefined,
          householdOfProvince: undefined, householdOfCity: undefined,
          householdOfArea: undefined, householdOfCounty: undefined,
          householdOfDetail: undefined, homeOfProvince: undefined,
          homeOfCity: undefined, homeOfArea: undefined, homeOfCounty: undefined,
          homeOfDetail: undefined, isTheSameAsHousehold: undefined,
          homeOfPostcode: undefined, homeOfPhone: undefined, concatOfName: undefined,
          concatWorkUnit: undefined, concatOfPhone: undefined, concatOfCardIdentity: undefined,
          collegeOfName: undefined, collegeOfInstitute: undefined,
          collegeOfMajor: undefined, collegeOfEducation: undefined,
          collegeWithStart: undefined, studentNo: undefined, typeOfMajor: undefined,
          collegeOfEducationalSystem: undefined,
          collegeWithEnd: undefined, workUnit: undefined, workFeature: undefined,
          phoneOfUnit: undefined, postcodeOfUnit: undefined, addressOfUnit: undefined,
          changeForReason: undefined
        };
        this.resetForm("form");
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.resetForm("queryForm");
        this.handleQuery();
      },
      /** 新增按钮操作 */
      handleAdd() {
        this.reset();
        this.open = true;
        this.title = "添加学生贷款数据";
        this.form.userName = this.queryParams.userName;
      },
      // 多选框选中数据
      handleSelectionChange(selection) {
        this.ids = selection.map(item => item.creditId)
        this.single = selection.length!=1
        this.multiple = !selection.length
      },
      /** 修改按钮操作 */
      handleUpdate(row) {
        this.reset();
        this.current_creditId = row.creditId
        this.now_creditId = row.creditId
        this.electronicImagePath = 'data:image/png;base64,' + row.electronicImage
        this.pdfPath = row.pdfWithSignaturePath
        console.log(this.pdfPath)
        const creditId = row.creditId || this.ids
        getData(creditId).then(response => {
          this.form = response.data;
          this.open = true;
          this.title = "修改学生贷款数据";
        });
      },
      /** 提交按钮 */
      submitForm: function() {
        this.$refs["form"].validate(valid => {
          if (valid) {
            if (this.form.creditId != undefined) {
              updateData(this.form).then(response => {
                if (response.code === 200) {
                  this.msgSuccess("修改成功");
                  this.open = false;
                  this.getList();
                }
              });
            } else {
              addData(this.form).then(response => {
                if (response.code === 200) {
                  this.msgSuccess("新增成功");
                  this.open = false;
                  this.getList();
                }
              });
            }
          }
        });
      },
      /** 删除按钮操作 */
      handleDelete(row) {
        const creditIds = row.creditId || this.ids;
        this.$confirm('是否确认删除学生贷款编码为"' + creditIds + '"的数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return delData(creditIds);
        }).then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        }).catch(function() {});
      },
      /** 导出按钮操作 */
      handleExport() {
        const queryParams = this.queryParams;
        this.$confirm('是否确认导出所有数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return exportData(queryParams);
        }).then(response => {
          this.download(response.msg);
        }).catch(function() {});
      },
      handlePictureCardPreview(file) {
        this.dialogImageUrl = file.url;
        this.dialogVisible = true;
      },
      handleDownload(file) {
        console.log(file);
      },
      handleSuccess(response, file, fileList) {
        this.$notify({
          title: '身份证照上传成功',
          type: 'success',
          duration: 2500
        })
      },
      // 监听上传失败
      handleError(e, file, fileList) {
        const msg = JSON.parse(e.message)
        this.$notify({
          title: msg.message,
          type: 'error',
          duration: 2500
        })
      },
      handleRemove(file, fileList) {
        console.log(file, fileList);
      },
    },
  };
</script>
